package com.minhua.jijiehao2.mainframe.mine.productListFragment.impl

import com.minhua.jijiehao2.bean.BaseBean
import com.minhua.jijiehao2.bean.ProductBean
import com.minhua.jijiehao2.http.*
import com.minhua.jijiehao2.mainframe.mine.productListFragment.imp.IProductListModel

class ProductListModel : IProductListModel {

    override fun getProductList(map: ParamsMap, callBack: CallBack<List<ProductBean>>) {
        HttpController<List<ProductBean>>().doHttp(
                ApiClient.getInstance().api.getProductList(map.toRequestBody()),
                object : BaseSubscriber<List<ProductBean>>() {
                    override fun dealData(t: BaseBean<List<ProductBean>>) {
                        callBack.onSuccess(t)
                    }
                },
                false
        )
    }

}